<link href="/static/css/power.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/static/js/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="/static/js/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css" />

<!--右边内容开始-->
<div class="page-header" style="margin: 20px 0 20px;">
    <span style="margin:0 0 20px 10px;">当前位置：<a href="?g=menu&r=adAdmin/rolelist">角色列表</a> >> 编辑角色权限</span>
</div>
<div class="right-con height-bug">
<div class="ba-contain">
	<div class="ba-contain">
		<!--右边主要内容开始-->
		<form action="?g=menu&r=adAdmin/rolepower" method="post" name="form1">
		<input type="hidden" name="roleid" value="{$roleid}" />
			
			<div class="competence" id="purview">
			<!--列出权限表项-->
			{$outplist}   
			</div>
            
			<div class="list-button" id="submitDiv" style="right: 5px; position: absolute;height: 40px; padding-top: 20px; text-align: center;">
				<input type="submit" value="提交"/>
			</div>
		</form>
	  <!--右边主要内容结束-->
	</div>
</div>
</div>
<!--右边内容结束-->
<script>
//总后台新建权限组页

/****选择所有的子选项***/
function selectallCheckbox(obj,id){
	idnode = document.getElementById('ul_'+id);
	put = idnode.getElementsByTagName("input");
	for(i=0;i<put.length;i++)
		  put[i].checked=obj.checked;
}

function checkParentCk(pid,obj){


    var pobj = document.getElementById(pid);
    if(obj.checked)
    {
         pobj.checked  = true;
         return ;
    }
    
    idnode = document.getElementById('ul_'+pid);
    var put = idnode.getElementsByTagName("input");
    var flag = 0;
    var count = put.length;
    for(i=0;i<count;i++)
    {
        if(put[i].checked ==  false)
        {
            flag++;
        }
    }
    
    if(flag == count)
    {
        pobj.checked = false;
    }
}


    lastScrollY = 0;                    
    function heartBeat() 
    {                        
        var diffY;                        
        if (document.documentElement && document.documentElement.scrollTop)                            
            diffY = document.documentElement.scrollTop;                        
        else if (document.body)                            
            diffY = document.body.scrollTop;                        
        else                        
        { /*Netscape stuff*/ }                        
       var  percent = .1 * (diffY - lastScrollY+10);                        
        if (percent > 0) 
            percent = Math.ceil(percent);                        
        else 
            percent = Math.floor(percent); 
         var cDiv =  document.getElementById('submitDiv');
         var divheight = cDiv.offsetHeight;
         var doc = (document.compatMode && document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
         var divTop = doc.scrollTop + (doc.clientHeight - divheight) / 2;
         cDiv.style.top = divTop + "px";

        cDiv.style.top = parseInt(cDiv.style.top) + percent + 'px';                 
        lastScrollY = lastScrollY + percent;                    
    }
    
    window.setInterval("heartBeat()", 1);
</script>
